import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

// export default new Router({
//   routes:[
//     {
//       path: '/',
//       component: () => import(/* webpackChunkName: "dashboard" */ '../components/common/Home.vue'),
//       meta: { title: '系统首页' }
//     },
//     {
//       path: '/login',
//       component: () => import(/* webpackChunkName: "dashboard" */ '../components/common/Header.vue'),
//       meta: { title: '系统首页' }
//     },
//     {
//       path: '*',
//       redirect: '/404'
//     }
//   ]
// });

const routes = [
  {
    path: '/',
    component: () => import(/* webpackChunkName: "dashboard" */ '../components/common/Home.vue'),
    meta: { title: '系统首页' }
  },
  {
    path: '/home',
    component: () => import(/* webpackChunkName: "dashboard" */ '../components/common/Home.vue'),
    meta: { title: '系统首页' }
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
  }
]

const router = new Router({
  //mode: 'history',//需要服务端的配置
  mode: "hash",
  base: process.env.publicPath,
  routes
})

export default router
